Calls to pfxstrategy() are not directly related in time to system functions called by a user process. For example, a filesystem may buffer many blocks of data in memory, so that the user process may execute dozens or hundreds of write() calls without causing an entry to the device driver. When the user function closes the file or calls fsync()--or when for unrelated reasons the filesystem needs to free some buffers--the filesystem calls pfxstrategy() to write numerous blocks of data.
In a driver that supports the character interface as well, the pfxstrategy() entry can be called indirectly from the pfxread(), pfxwrite() and pfxioctl() entries, as described under "Calling Entry Point strategy() From Entry Point read() or write()".
The prototype of the pfxstrategy() entry point is
The argument is the address of a buf_t structure, which gives the strategy routine the information it needs to perform the I/O:int pfxstrategy(struct buf *bp);
The driver uses the information in the buf_t to validate the data transfer and programs the device to start the transfer. Then it stores the address of the buf_t where the interrupt handler can find it (see "Entry Point intr()") and calls biowait() to wait for the operation to complete. For the next step, see "Completing Block I/O" (see also the biowait(D3) reference page).